package com.kaifamiao.date1110;

import java.util.logging.Logger;

/**
 * 使用方法重置可以实现编译时多态
 */
public class Monkey {
	
	private final Logger logger = Logger.getLogger( this.getClass().getName() );
	
	private String name ;
	
	public Monkey() {
		super();
	}

	public Monkey(String name) {
		super();
		this.name = name;
	}

	public int add( int a , int b ) {
		logger.info( "add(int,int)" );
		return a + b ;
	}
	
	public long add( long a , long b ) {
		logger.info( "add(long,long)" );
		return a + b ;
	}
	
	public double add( double a , double b ) {
		logger.info( "add(double,double)" );
		return a + b ;
	}
	
	public boolean equals( Monkey another ) {
		logger.info( "equals(Monkey)" );
		if( another == null ) {
			return false ;
		}
		return name.equals( another.name );
	}

}
